package wang.unclecat.actcaller;

import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;


/**
 * Activity#startActivityForResult()+onActivityResult()转变为Callback形式
 *
 * @author: 喵叔catuncle
 * @date: 2021-02-15 17:33
 */
public class ActCaller {
    private ActCaller() {
    }

    public static void startForResult(AbilitySlice slice, Intent intent, Callback callback) {
        slice.present(new RouterSlice(callback), intent);
    }

    public interface Callback {
        void onAbilityResult(Intent result);
    }

}
